package com.partsoft.dits;



import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ObjectUtils;

/**
 * 抽象的描述符注册表实现
 * @param <E> 实现{@link EdgeDescriptor}接口
 */
public abstract class AbstractDescriptorRegistry<E extends EdgeDescriptor> implements
		DescriptorRegistry<E> {
	
	public boolean supportDescriptor(Class<?> descriptClazz) {
		return ObjectUtils.nullSafeEquals(getSupportClass(), descriptClazz);
	}
	
	public boolean supportDescriptor(E descriptor) {
		Assert.notNull(descriptor);
		return supportDescriptor(ClassUtils.getUserClass(descriptor));
	}

}
